<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | Workerman设置 仅对 php think worker:gateway 指令有效
// +----------------------------------------------------------------------
return [
    // 扩展自身需要的配置
    'protocol'              => env('worker.protocol', 'websocket'), // 协议 支持 tcp udp unix http websocket text
    'host'                  => env('worker.host', '0.0.0.0'), // 监听地址
    'port'                  => env('worker.port', 2348), // 监听端口
    'socket'                => env('worker.socket', ''), // 完整监听地址
    'context'               => env('worker.context', []), // socket 上下文选项
    'register_deploy'       => env('worker.register_deploy', true), // 是否需要部署register
    'businessWorker_deploy' => env('worker.business_worker_deploy', true), // 是否需要部署businessWorker
    'gateway_deploy'        => env('worker.gateway_deploy', true), // 是否需要部署gateway

    // Register配置
    'registerAddress'       => env('register.register_address', '127.0.0.1:1236'),

    // Gateway配置
    'name'                  => env('gateway.name', 'thinkphp'),
    'count'                 => env('gateway.count', 1),
    'lanIp'                 => env('gateway.lan_ip', '127.0.0.1'),
    'startPort'             => env('gateway.start_port', 2000),
    'daemonize'             => env('gateway.daemonize', false),
    'pingInterval'          => env('gateway.ping_interval', 30),
    'pingNotResponseLimit'  => env('gateway.ping_not_responseLimit', 0),
    'pingData'              => env('gateway.ping_data', 'ping'),

    // BusinsessWorker配置
    'businessWorker'        => [
        'name'         => env('business.name', 'BusinessWorker'),
        'count'        => env('business.count', 1),
        'eventHandler' => env('business.event_handler', '\app\common\service\WsEventService'),
    ],

];
